<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/includes/common-import.jsp"%>
<%@ taglib uri="/page" prefix="p"%>
<%@ taglib uri="/data" prefix="d"%>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<head>
	<meta charset="utf-8" />
	<title>${systemName}</title>
	<meta content="width=device-width, initial-scale=1.0" name="viewport" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	<%@ include file="/WEB-INF/includes/common-component-list.jsp"%>
</head>
<body class="page-header-fixed">
	<%@ include file="/WEB-INF/includes/header.jsp"%>
	<!-- BEGIN CONTAINER -->
	<div class="page-container row-fluid">
		<%@ include file="/WEB-INF/includes/leftMenu.jsp"%>
		<div class="page-content">
			<!-- BEGIN PAGE CONTAINER-->        
			<div class="container-fluid">
				<!-- BEGIN PAGE HEADER-->
				<div class="row-fluid">
					<div class="span12">
						<h3 class="page-title">
							班级管理
						</h3>
					</div>
				</div>
				<div class="row-fluid">
					<div class="span12">
						<form id="searchForm" class="form-horizontal" action="${basePath }classes" method="post">
							<div class="portlet">
								<div class="portlet-title">
									<div class="input-prepend input-append">
										<span class="add-on"><i class="icon-search"></i></span>
										<input class="m-wrap placeholder-no-fix" type="text" 
											placeholder="按班级名称查询..." id="className" name="map['className']" value="${searchParams.map['className'] }"/>
										<button type="submit" class="btn green pull-right" >查询</button> 
									</div>
								</div>
							</div>
						</form>
						<div class="alert alert-success ${empty MESSAGE ?'hide':'' }">
							<button class="close" data-dismiss="alert"></button>
							<span>${MESSAGE }</span>
						</div>
						<div class="portlet box light-grey">
							<div class="clearfix">
									<div class="btn-group">
										<a id="sample_editable_1_new" class="btn green" href="${basePath }classes/create">
											新增 <i class="icon-plus"></i>
										</a>
									</div>
								</div>
								<table class="table table-striped table-bordered table-hover" id="sample_1">
									<thead>
										<tr>
											<th style="width:40px;">序号</th>
											<th>班级名称</th> 
<th>专业</th> 
<th>年级</th> 
<th>其它</th> 

											<th>操作</th>
										</tr>
									</thead>
									<tbody>
										<c:forEach items="${list}" var="list" varStatus="status">
											<tr class="odd gradeX">
												<td>${status.index+1 }</td>
												<td>${list.className }</td> 
<td><d:view tableName="professional" field="pro_name" primaryValue="${list.professionalId }"/></td> 
<td><d:view tableName="Grade" field="grade_name" primaryValue="${list.gradeId }"/></td> 
<td>${list.remark }</td> 

												<td >
													<a class="edit" href="${basePath}classes/update/${list.id}">修改</a>&nbsp;
													<a class="edit" onclick="del('${list.id}');" href="javascript:void();">删除</a>
												</td>
											</tr>
										</c:forEach>
									</tbody>
								</table>
								<p:page url="classes" cpage="${page.cpage }" perItem="${page.perItem }" totalItem="${page.totalItem }"/>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
<script>
	function del(id){
		if(confirm("确认要进行删除吗？")){
			window.location="${basePath}classes/delete/" + id;
		}
	}
</script>
</html>
